//搜索栏提示
var searchTxt = $('#mainNav .searchField .txt');
searchTxt.focus(function(){
	if($(this).val()=='驾车宝典'){
		$(this).val('').css('color','#333');
	}
});
searchTxt.blur(function(){
	if($(this).val()==''){
		$(this).val('驾车宝典').css('color','#9f9f9f');
	}
});

//活动内容页报名用户展开
var showMemberBtn = $('.forumContentPanel_01 .memberField .btns .btn1');
var showMemberField = $('.forumContentPanel_01 .memberField .list ul');
var showMemberHeight0 = showMemberField.height();
showMemberField.css('height','auto');
var showMemberHeight1 = showMemberField.height();
showMemberField.css('height',showMemberHeight0);
var showMemberOpen = false;
showMemberBtn.click(function(){
	if(showMemberOpen){
		showMemberField.stop().animate({height:showMemberHeight0},300);
		showMemberBtn.removeClass('on');
		showMemberOpen = false;
	}else{
		showMemberField.stop().animate({height:showMemberHeight1},300);
		showMemberBtn.addClass('on');
		showMemberOpen = true;
	}
});


//活动内容页点击我要报名
var signUpBtn = $('.signUpPanel_01 .btnField .btn');
var signUpField = $('#jumpBox');
var signUpClose = $('#jumpBox .close');

signUpBtn.click(function(){
	signUpField.fadeIn(300);
});

signUpClose.click(function(){
	signUpField.fadeOut(300);
});


//让左右两边对齐的JS 如对齐方式有误 请注释掉以下整段文档 或在无需自动对齐的页面最末写上以下代码<script>autoEqHeight = false;</script>
var leftLastItem = $('#leftArea').children().last();
var rightLastItem = $('#rightArea').children().last();
var autoEqHeight = true;

function eqHeight(){
	if(leftLastItem.length&&rightLastItem.length){
		if(leftLastItem.offset().top+leftLastItem[0].offsetHeight<rightLastItem.offset().top+rightLastItem[0].offsetHeight){
			leftLastItem.css('height',leftLastItem.height()+rightLastItem.offset().top+rightLastItem[0].offsetHeight -leftLastItem.offset().top-leftLastItem[0].offsetHeight );
		}else{
			rightLastItem.css('height',rightLastItem.height()+leftLastItem.offset().top+leftLastItem[0].offsetHeight -rightLastItem.offset().top-rightLastItem[0].offsetHeight );
		}
	}
}
var eqHeightTimeout = setTimeout(function(){
	if(autoEqHeight){
		eqHeight();
	}
},100);